#include "rrscreenmapping.h"

RRScreenMapping::RRScreenMapping()
{
    v_w = 640;
    v_h = 480;
    v_x0 = 0;
    v_y0 = 0;

    s_right = 2.0f;
    s_top = 1.5f;
    s_left = -2.0f;
    s_bottom = -1.5f;
}

void RRScreenMapping::rrScreenMapping(int xv, int yv, float *xs, float *ys)
{
    *xs = (s_right - s_left) * (xv - v_x0) / (float)v_w + s_left;
    *ys = (s_top - s_bottom) * (yv - v_y0) / (float)v_h + s_bottom;
}
